<template>
	<view class="list-info" @click="onItemClick(goodsInfo.pid)">
		<image :src="goodsInfo.cover" class="item-img" mode="aspectFill"></image>
		<view style="display: flex;flex-direction: column;flex: 1;margin-right: 32rpx;">
			<view class="item-title">{{goodsInfo.title}}</view>
			<view style="display: flex;margin-top: 8rpx;font-size: 24rpx;">
				<text class="item-type">高佣{{goodsInfo.kolCosRatio}}%</text>
				<text style="color: #999999;flex: 1;text-align: right;">销量 {{goodsInfo.sales}}</text>
			</view>
			<view style="flex: 1;"></view>
			<view style="display: flex;align-items: center;margin-top: 16rpx;">
				<view style="display: flex;font-size: 24rpx;">
					<text style="color: #EE0A24;margin-top: 12rpx;">¥</text>
					<text style="color: #EE0A24;font-size: 36rpx;">{{goodsInfo.price}}</text>
				</view>
				<view style="flex: 1;"></view>
				<view class="item-showcase-btn">
					<text>赚¥{{goodsInfo.kolCosFee}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			goodsInfo: {
				type: Object,
				default() {
					return {}
				}
			},
		},
		data() {
			return {
				
			}
		},
		methods: {
			onItemClick(item){
				this.$emit('onItemClick',item);
			}
		}
	}
</script>

<style>
	.list-info {
		display: flex;
		flex-direction: row;
		margin-top: 16rpx;
		width: 100vw;
	}
	.item-img {
		width: 188rpx;
		height: 188rpx;
		margin-left: 32rpx;
		border-radius: 32rpx;
		margin-right: 24rpx;
	}
	.item-title {
		color: #333333;
		font-size: 28rpx;
		line-height: 39rpx;
		font-family: PingFang SC;
		font-weight: 500;
		white-space: pre-wrap;
		overflow: hidden;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
	}
	.item-type {
		background: #FF5733;
		border-radius: 4rpx;
		font-size: 24rpx;
		font-family: MiSans-Regular, MiSans;
		font-weight: 400;
		color: #FFFFFF;
		line-height: 32rpx;
		text-align: center;
		padding-left: 8rpx;
		padding-right: 8rpx;
		margin-right: 16rpx;
	}
	.item-showcase-btn {
		height: 64rpx;
		margin-left: 24rpx;
		background: linear-gradient(138deg, #F7CB47 0%, #C2CF51 100%);
		border-radius: 64rpx;
	}
	.item-showcase-btn text {
		margin-left: 32rpx;
		margin-right: 32rpx;
		font-size: 28rpx;
		font-family: MiSans-Regular, MiSans;
		font-weight: 400;
		color: #FFFFFF;
		text-align: center;
		line-height: 64rpx;
	}
</style>
